package com.cy.service;

import com.cy.pj.goods.dao.GoodsDao;
import com.cy.pj.goods.pojo.Goods;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImp implements GoodsService{
    private final static Logger loger=LoggerFactory.getLogger(GoodsServiceImp.class);

    @Autowired
    private GoodsDao goodsDao;

    @Override
    public List<Goods> runtime() {
        Long start = System.currentTimeMillis();
        List<Goods> list = goodsDao.findGoods();
        Long ends = System.currentTimeMillis();
        Long allTimes = ends - start;
        loger.info("ends-start={}",(ends - start));
        System.out.println(allTimes);
        return list;
    }
}
